package com.meta.act.app.domain.tenant;

import com.meta.act.app.tenant.entity.TenantUser;
import com.meta.framework.define.DelFlagEnum;
import org.springframework.util.Assert;

/**
 * java类简单作用描述
 *
 * @Title:
 * @Package: com.meta.act.app.domain.tenant.
 * @Author: M.simple
 * @Remark: The modified content
 * @CreateDate: 2020/11/25 3:01 下午
 * @Version: v2.0
 */
public class TenantUserDo extends TenantUser {

	public static TenantUserDo of(Long userId, Long tenantId, Long deptId){

		Assert.notNull(userId, "用户ID不为空");
		//Assert.notNull(tenantId, "租户ID不为空");

		TenantUserDo tenantUserDo = new TenantUserDo();
		tenantUserDo.setUserId(userId);
		tenantUserDo.setTenantId(tenantId);
		tenantUserDo.setDeptId(deptId);
		return tenantUserDo;
	}

	public void chageDept(Long deptId) {
		this.setDeptId(deptId);
	}

	public void deleteTenantUser() {

		this.setDelFlag(DelFlagEnum.I.getCode());
	}
}
